package com.rui.study.algorithm.P_正则表达式匹配;

/**
 * @program: study
 * @description:
 * @author: Yaowr
 * @create: 2019-01-09 09:39
 **/
public class Solution3动态规划 {

    /**
     * '.' 匹配任意单个字符。
     * '*' 匹配零个或多个前面的元素。
     *
     * 输入:
     * s = "aab"
     * p = "c*a*b"
     * 输出: true
     *
     * 输入:
     * s = "mississippi"
     * p = "mis*is*p*."
     * 输出: false
     * @param s
     * @param p
     * @return
     */
    public boolean isMatch(String s, String p) {
        boolean matched = false;
//        int n = s.length(), m = p.length();
//
//        boolean[][] state = new boolean[m][n];
//
//        int i = m, j = n;
//        while (i >= 0 && j >= 0) {
//            if (p.charAt(j) == '*') {
//                j--;
//            }
//        }
        return matched;
    }


    public static void main(String[] args) {
        long begin = System.currentTimeMillis();
        Solution3动态规划 solution = new Solution3动态规划();
        boolean result = solution.isMatch("ab", "aa*.*c");
        long end = System.currentTimeMillis();
        System.out.println("是否匹配：" + result + ", 耗时：[" + (end - begin) + "ms]");
    }
}
